/***************************************************************************/
/* NOTE:                                                                   */
/* This document is copyright (c) by Oz Solomonovich.  All non-commercial  */
/* use is allowed, as long as this document not altered in any way, and    */
/* due credit is given.                                                    */
/***************************************************************************/

// TabManagerWindow.h : header file
//

#if !defined(AFX_TABMANAGERWINDOW_H__616A6550_C284_11D2_BC92_0000010016A6__INCLUDED_)
#define AFX_TABMANAGERWINDOW_H__616A6550_C284_11D2_BC92_0000010016A6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "SubclassWnd.h"

/////////////////////////////////////////////////////////////////////////////
// CTabManagerWindow window

//##ModelId=431C34C6033C
class CTabManagerWindow : public CSubclassWnd
{
    friend class CTabBarsWnd;

// Construction
public:
	//##ModelId=431C34C6034C
	CTabManagerWindow(IGenericWindow *pGWindow, HWND hSubclassWindow = 0);

// Attributes
public:
	//##ModelId=431C34C6038B
	CComQIPtr<IGenericWindow, &IID_IGenericWindow> m_pGWindow;

	//##ModelId=431C34C6038F
	virtual bool  SetManaging (bool bManaging);
	//##ModelId=431C34C6039B
	virtual bool  SetMakeSpace(bool bMakeSpace);
	//##ModelId=431C34C603B9
	virtual CRect SetBorder(CRect Border);

	//##ModelId=431C34C603C8
	bool  GetManaging()  { return m_bManaging; }
	//##ModelId=431C34C603C9
	bool  GetMakeSpace() { return m_bMakeSpace; }
	//##ModelId=431C34C603CA
	CRect GetBorder()    { return m_Border; }

// Operations
public:
	//##ModelId=431C34C603D8
    void PostUpdateMessage();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTabManagerWindow)
	//}}AFX_VIRTUAL

// Implementation
public:
//	void OnWizard();
	//##ModelId=431C34C603D9
	virtual ~CTabManagerWindow();

	// Generated message map functions
protected:
	//##ModelId=431C34C70000
	bool  m_bMakeSpace;
	//##ModelId=431C34C7000F
	bool  m_bManaging;
	//##ModelId=431C34C70010
	bool  m_bUpdatePosted;
	//##ModelId=431C34C7001F
	CRect m_Border;
	//##ModelId=431C34C70020
	CRect m_LastPos;
	//##ModelId=431C34C7002E
	int   m_iTabHeight;
	//##ModelId=431C34C7003E
	int   m_iTabWidth;

	//##ModelId=431C34C7004E
	void CheckTabCount();
	//##ModelId=431C34C7005D
	void ForceRedraw();
	//##ModelId=431C34C7005E
	void ReclameTabSpace();
	//##ModelId=431C34C7005F
	void UpdateTabSizeAndPosition(CRect& WndRect);
	//##ModelId=431C34C7007D
	void UpdateTabSize();

	//##ModelId=431C34C7007E
	virtual CSize CalcTabsSize(SnapOrientations o) const;
	//##ModelId=431C34C7008D
	virtual bool CalcTabsPosition(CRect& WndRect, CRect& TabsRect,SnapOrientations o) const;

    //{{AFX_MSG(CTabManagerWindow)
	//##ModelId=431C34C700AC
	afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
	//}}AFX_MSG
	//##ModelId=431C34C700BB
	afx_msg LRESULT OnUpdateTabs(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TABMANAGERWINDOW_H__616A6550_C284_11D2_BC92_0000010016A6__INCLUDED_)
